<?
//$date_x=microtime();
                         /*
$DATEDUJOUR = date("D");
IF ($DATEDUJOUR !='Thu' && $DATEDUJOUR!='Mon'){ EXIT;}
                          */
REQUIRE("../../protect/connect_jeu.php");
$query="SELECT ressource_ville FROM sdville_ressource group by ressource_ville";
$resultatx=mysql_query($query);
WHILE($tmp2=mysql_fetch_array($resultatx)){


$query="SELECT ressource_x,ressource_y,ressource_gain FROM sdville_ressource where ressource_ville=$tmp2[0] AND ressource_temps!=0";
$resultat=mysql_query($query);


       echo $query;
$TMP_RESS=NULL;
$i=0;
WHILE($tmp=mysql_fetch_array($resultat)){
       $TMP_RESS[$i]=$tmp[2];
       $i++;

}
IF (!empty($TMP_RESS)){
    $TMP_RESS2=implode("/",$TMP_RESS);
    $query="UPDATE sdville SET ville_ressourse_tour= '$TMP_RESS2' WHERE ville_id=$tmp2[0]";
    $resultat=mysql_query($query);
}


}

$query="UPDATE sdville_ressource SET ressource_temps= 1 WHERE   ressource_temps= 0";
$resultat2=mysql_query($query);

?>


